package net.hn.hnms.biz.safety.monitor.service;

import net.hn.hnms.biz.api.feign.model.DataStateVo;
import net.hn.hnms.biz.api.mine.model.AlarmMessageItemVo;
import net.hn.hnms.biz.api.safety.monitor.model.*;
import net.hn.hnms.biz.api.safety.water.model.SubsidenceAnalysisVo;
import net.hn.hnms.biz.common.jpa.utils.ResponsePage;
import net.hn.hnms.biz.safety.monitor.domain.dto.DataConfiginfoDto;
import net.hn.hnms.biz.safety.monitor.domain.dto.PointListVO;
import net.hn.hnms.biz.api.safety.location.model.OutLimitAlarmingInfoVO;
import net.hn.hnms.biz.safety.monitor.domain.vo.GasAnalysisVo;
import net.hn.hnms.biz.safety.monitor.domain.vo.keyAreasVo;
import net.hn.hnms.biz.safety.monitor.domain.AqjkHisSensorMonitorEntity;
import net.hn.hnms.biz.safety.monitor.domain.AqjkNowBaseSensorinfoEntity;
import net.hn.hnms.biz.safety.monitor.domain.AqjkNowSensorMonitorEntity;
import net.hn.hnms.biz.safety.monitor.domain.SensorAlarmEntity;
import org.springframework.data.domain.Pageable;

import java.util.Date;
import java.util.List;

/**
 * 智呈物联 pan'sx
 * 2022/7/31 10:14
 * 1.0 version
 */

public interface SafetyMonitorService {

    //今日报警信息
    MonitorTodayInfo getTodayInfo(String mineCode);
    //关键区域
    List<KeyAreasVo> keyAreas(String areaId, String mineCode);

    /**
     * 报警趋势
     * @return
     */
    AlarmTrendVo alarmTrend(String mineCode,String type);

    /**
     * 安全检测列表
     * @return
     */
    List<SafetyMonitorVo> safetyMonitor(String mineCode);

    /**
     * 重点测点统计
     * @return
     */
    List<PointStatistics> pointStatistics(String mineCode);

    /**
     * 重要指标
     * @return
     */
    Indicator indicator(String mineCode);

    /**
     * 安全监控报警趋势
     * @param type
     * @return
     */
    AlarmTrendVo indexAlarmTrend(String type,String mineCode);

    /**
     * 工作面
     * @return
     */
    List<String> getWorkFace(String mineCode);

    /**
     * 报警分页
     * @return
     */
    ResponsePage<SensorAlarmEntity> sensorAlarmPage(Pageable pageable, String sensorType, String outlierType, String beginTime, String endTime, String mineCode);

    /**
     * 实时列表
      * @param pageable
     * @param sensorType
     * @param pointLocation
     * @param status
     * @return
     */
    ResponsePage<AqjkNowSensorMonitorEntity> sensorMonitorNow(Pageable pageable, String pointLocation, String sensorType, String status, String mineCode);

    /**
     * 历史列表
     * @param pageable
     * @return
     */
    ResponsePage<AqjkHisSensorMonitorEntity> sensorMonitorHis(Pageable pageable, String sensorType, String beginTime, String endTime, String loaction, String mineCode);

    /**
     * 测点图表
     * @param pointCode
     * @param beginTime
     * @param endTime
     * @return
     */
    List<AqjkHisSensorMonitorEntity> findByPointCodeAndDataTimeBetween(String pointCode, Date beginTime, Date endTime,String mineCode);
    /**
     * 实时列表
     * @param pageable
     * @param sensorType
     * @return
     */
    ResponsePage<AqjkNowBaseSensorinfoEntity> baseSensorInfo(Pageable pageable, String sensorType, String location, boolean currentValue, String mineCode);

    /**
     * 查询监测值曲线图
     * @param sensorCode
     * @return
     */
    SensorValueTrendVo trendBySensorCode(String sensorCode, String mineCode);

    /**
     * 传感器异常数据记录列表
     * @param pointCode
     * @param beginTime
     * @param endTime
     * @return
     */
    List<SensorAlarmEntity> pointExceptionRecordDataList(String pointCode, Date beginTime, Date endTime,String mineCode);

    /**
     *
     * @param x
     * @param y
     * @param z
     * @return
     */
    List<SafetyMonitorVo> environmentalAwareness(Double x,Double y, Double z,String mineCode);

    /**
     * 工作面甲烷曲线
     * @param pointCodes
     * @return
     */
    SubsidenceAnalysisVo concentration(String [] pointCodes,String mineCode);

    /**
     * 测点状态
     * @param workFace
     * @return
     */
    PointStatus pointStatus(String workFace, String mineCode);

    /**
     * 涌出量预测
     * @return
     */
    SubsidenceAnalysisVo gushTrend();


    SubsidenceAnalysisVo coalEarlyWarning();

    /**
     * 报警消息
     * @return
     */
    List<AlarmMessageItemVo> alarmMessageItem(String mineCode);

    /**
     * 获取最新数据时间
     * @param mineCode
     * @param companyCode
     * @return
     */
    List<DataStateVo> getMaxTime(String mineCode, String companyCode);

    /**
     * 根据工作面获取重点区域信息
     * @param mineCode
     * @return
     */
    List<keyAreasVo> getkeyAreasInfoByWorkFace(String workFaceName, String mineCode);

    /**
     * 根据测点类型获取所有测点
     * @param pointTypeName
     * @param mineCode
     * @return
     */
    List<PointListVO> getPointListByPointType(String pointTypeName, String mineCode);

    /**
     * 更新关键区域测点配置信息
     * @param dataConfiginfoDto

     * @return
     */
    Boolean upDataConfiginfo(DataConfiginfoDto dataConfiginfoDto);

    /**
     * 获取安全监控BaseSensorTable表所有信息
     * @return
     */
    List<BaseSensorCoordDto> getBaseSensorTableAllList(String mineCode);

    /**
     * 获取当天报警超限信息
     * @param mineCode
     * @return
     */
    List<OutLimitAlarmingInfoVO> alarmInfoList(String mineCode);

    /**
     * 获取瓦斯涌出量变化趋势
     * @return
     */
    GasAnalysisVo getCurrentGasTrend();

}
